package com.backend.system.beans;

import cn.hutool.core.collection.CollUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 批量删除请求体
 *
 * @author backend-manage
 */
@ApiModel
@Data
public class DeleteBatchReq implements Serializable {
    @Serial
    private static final long serialVersionUID = -5990990302153105862L;

    /**
     * 要删除的数据的ID列表
     */
    @ApiModelProperty(value = "ID列表", required = true)
    @NotEmpty(message = "要删除的数据ID列表不能为空")
    private List<Long> ids;


    /**
     * 对ID列表去重
     */
    public void distinctIdList() {
        this.ids = CollUtil.distinct(ids);
    }
}
